//
//  CHYYGLTableViewCell.m
//  CarFile
//
//  Created by 陈浩 on 2018/1/19.
//  Copyright © 2018年 陈浩. All rights reserved.
//

#import "CHYYGLTableViewCell.h"

@interface CHYYGLTableViewCell()

@property (weak, nonatomic) IBOutlet UILabel *ordertimeLabel;      //  下单时间
@property (weak, nonatomic) IBOutlet UILabel *companynameLabel;    //  企业名称
@property (weak, nonatomic) IBOutlet UILabel *linkmanLabel;      //  车主
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;       //   预约时间
@property (weak, nonatomic) IBOutlet UILabel *replaycontentLabel;    //  回复内容

@end
@implementation CHYYGLTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

+(instancetype)cellForTableView:(UITableView *)tableView{
    static NSString *ID = @"CHYYGLTableViewCell";
    CHYYGLTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell =  [[[NSBundle mainBundle]loadNibNamed:@"CHYYGLTableViewCell" owner:nil options:nil] lastObject];
    }
    return cell;
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
    }
    return self;
}

-(void)setModel:(CHYYGLModel *)model{
    _model = model;
    
    self.ordertimeLabel.text = [NSString stringWithFormat:@"下单时间：%@",model.ordertime];
    self.companynameLabel.text = model.companyname;
    self.linkmanLabel.text =[NSString stringWithFormat:@"%@【%@】",model.linkman,model.carname];
   
    NSArray *timeArr = [model.time componentsSeparatedByString:@" "];
    self.timeLabel.text = timeArr[0];
    
    self.replaycontentLabel.text = model.replaycontent.length > 0 ? model.replaycontent : @"暂未回复";
   
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
